import { postRequest, getRequest } from '/src/lib/axios';
export const calculationEngineSettings = {
  query: (param) => {
    return postRequest('/carbonAssets/queryPage', {
      ...param,
      searchCount: true,
      sortItemList: [
        {
          isAsc: true,
          column: 'asset_id',
        },
      ],
    });
  },
  Add: (param) => {
    return postRequest('/carbonAssets/add', param);
  },
  Update: (param) => {
    return postRequest('/carbonAssets/update', param);
  },
  Delete: (param) => {
    return getRequest(`/carbonAssets/delete/${param}`);
  },
  queryIndustry: (param) => {
    return postRequest('/industry/queryPage', {
      ...param,
      searchCount: true,
      sortItemList: [
        {
          isAsc: true,
          column: 'industry_id',
        },
      ],
    });
  },
  queryCalculationModels: (param) => {
    return postRequest('/calculationModels/queryPage', {
      ...param,
      searchCount: true,
      sortItemList: [
        {
          isAsc: true,
          column: 'model_id',
        },
      ],
    });
  },
  queryOperationalBoundaries: (param) => {
    return postRequest('/operationalBoundaries/queryPage', {
      ...param,
      searchCount: true,
      sortItemList: [
        {
          isAsc: true,
          column: 'operational_boundaries_id',
        },
      ],
    });
  },
  queryGeographicalBoundaries: (param) => {
    return postRequest('/geographicalBoundaries/queryPage', {
      ...param,
      searchCount: true,
      sortItemList: [
        {
          isAsc: true,
          column: 'geographical_boundaries_id',
        },
      ],
    });
  },
  queryTimeBoundaries: (param) => {
    return postRequest('/timeBoundaries/queryPage', {
      ...param,
      searchCount: true,
      sortItemList: [
        {
          isAsc: true,
          column: 'time_boundaries_id',
        },
      ],
    });
  },
  queryEmissionFactors: (param) => {
    return postRequest('/emissionFactors/queryPage', {
      ...param,
      searchCount: true,
      sortItemList: [
        {
          isAsc: true,
          column: 'emission_factors_id',
        },
      ],
    });
  },
};
